local rolely_shenwu = fk.CreateSkill {
    name = "rolely_shenwu",
}

Fk:loadTranslationTable {
    ["rolely_shenwu"] = "神武",
    [":rolely_shenwu"] = "游戏开始时，从<a href='shenwuku'>神武装备库</a>中依次将两张不同副类别的装备置入装备区，以此法获得的牌离开装备区后，你摸剩余1+装备数等量的牌。",

    ["shenwuku"] = "#\"<b>神武装备库</b>\"：<a href=':lvbu_fjswj_dfjd'>【飞将神威】</a>，<a href=':lvbu_hmbhp_dfjd'>【红棉百花袍】</a>，" ..
        "<a href=':lvbu_hlzjg_dfjd'>【红莲紫金冠】</a>,<a href=':lvbu_fmjgc_dfjd'>【伏魔金刚】</a>,<a href=':lvbu_yhshl_dfjd'>【幽火摄魂】</a>," ..
        "<a href=':lvbu_llsmd_dfjd'>【玲珑狮蛮带】</a>,<a href=':lvbu_lyxlj_dfjd'>【炼狱修罗戟】</a>,<a href=':spear_sxzb_dfjd'>【神啸丈八】</a>",

    ["$rolely_shenwu1"] = "剑锋所指，万军辟易！",
    ["$rolely_shenwu2"] = "神锋出鞘，见血方还！",
}
rolely_shenwu:addEffect(fk.GameStart, {
    anim_type = "drawcard",
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(rolely_shenwu.name)
    end,
    on_cost = Util.TrueFunc,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local shenwuWeapon = {
            "lvbu_hlzjg_dfjd",
            "lvbu_hmbhp_dfjd",
            "lvbu_fjswj_dfjd",
            "lvbu_fmjgc_dfjd",
            "lvbu_yhshl_dfjd",
            "lvbu_llsmd_dfjd",
            "lvbu_lyxlj_dfjd",
            "spear_sxzb_dfjd" }
        local equipMap = {}
        for _, id in ipairs(room.void) do
            local sub_type = Fk:getCardById(id).sub_type
            if Fk:getCardById(id).type == Card.TypeEquip and player:canMoveCardIntoEquip(id, false) and table.contains(shenwuWeapon, Fk:getCardById(id).name) then
                local list = equipMap[tostring(sub_type)] or {}
                table.insert(list, id)
                equipMap[tostring(sub_type)] = list
            end
        end
        local sub_types = {}
        for k, _ in pairs(equipMap) do
            table.insert(sub_types, k)
        end
        sub_types = table.random(sub_types, 2)
        local cards = {}
        for _, sub_type in ipairs(sub_types) do
            table.insert(cards, table.random(equipMap[sub_type]))
        end
        if #cards > 0 then
            room:moveCardIntoEquip(player, cards, rolely_shenwu.name, false, player)
        end
    end,
})
rolely_shenwu:addEffect(fk.AfterCardsMove, {
    can_trigger = function(self, event, target, player, data)
        local shenwuWeapon = {
            "lvbu_hlzjg_dfjd",
            "lvbu_hmbhp_dfjd",
            "lvbu_fjswj_dfjd",
            "lvbu_fmjgc_dfjd",
            "lvbu_yhshl_dfjd",
            "lvbu_llsmd_dfjd",
            "lvbu_lyxlj_dfjd",
            "spear_sxzb_dfjd" }
        if player.dead then return end
        for _, move in ipairs(data) do
            if move.from == player then
                for _, info in ipairs(move.moveInfo) do
                    if info.fromArea == Card.PlayerEquip and table.contains(shenwuWeapon, Fk:getCardById(info.cardId).name) then
                        return player:hasSkill(rolely_shenwu.name)
                    end
                end
            end
        end
    end,
    on_cost = Util.TrueFunc,
    on_use = function(self, event, target, player, data)
        player:drawCards(#player:getCardIds("e") + 1, rolely_shenwu.name)
    end,
})
return rolely_shenwu
